package sis.utiltest;/*
 * @auther 顶风少年
 * @mail dfsn19970313@foxmail.com
 * @date 2019-08-03 10:12
 * @notify
 * @version 1.0
 */

import junit.framework.TestCase;
import sis.util.MultiHashMap;

import java.util.Collection;
import java.util.Date;
import java.util.Iterator;

public class MultHashMapTest extends TestCase {
    private static final Date today = new Date();
    private static final Date tomorrow = new Date(today.getTime()+86400000);

    private static final String eventA = "wake up";
    private static final String eventB = "eat";

    private MultiHashMap<Date,String>events;

    protected void setUp(){
        events = new MultiHashMap<>();
    }

    public void testCreate(){
        assertEquals(0,events.size());
    }

//    public void testSingleEntry(){
//        events.put(today,eventA);
//        assertEquals(1,events.size());
//        assertEquals(eventA,getSoleEvent(today));
//    }

//    public vod testMultipleEntriesDifferentKey(){
//        events.put(today,eventA);
//        events.put(tomorrow,eventB);
//        assertEquals(1,events.size());
//        Collection<String> retrievedEvents = events.get(today);
//        assertEquals(2,retrievedEvents.size());
//        assertTrue(retrievedEvents.contains(eventA));
//        assertTrue(retrievedEvents.contains(eventB));
//    }
//
//    public void testMultipleEntriesSameKey(){
//        events.put(today,eventA);
//        events.put(today,eventB);
//        assertEquals(1,events.size());
//        Collection<String> retrievedEvents = events.get(today);
//        assertEquals(2,retrievedEvents.size());
//        assertTrue(retrievedEvents.contains(eventA));
//        assertTrue(retrievedEvents.contains(eventB));
//    }
//
//    private String getSoleEvent(Date date){
//        Collection<String>retrieveEvents = events.get(date);
//        assertEquals(1,retrieveEvents.size());
//        Iterator<String> it = retrievedEvents.iteraotr();
//        return it.neex();
//    }

}
